Generally, the beneficial results of playing television commercials or television series may be realized by gathering statistics about audience ratings. Recently, a variety of digital signages are widely used. However, no unified and efficient system has been developed to gather statistics about the beneficial results of playing advertisements. It is very important for the advertisers to select and play different advertisements and assess the audience concerns on the advertisements according to the audience feedback. Consequently, many researchers make efforts in the development of the technology of counting the number of persons in front of the digital signage. A known method of counting the number of persons will be described in more details as follows.
FIG. 1 is a flowchart illustrating a conventional method of counting and tracking the number of persons. Firstly, in the step 110, a database is provided. At least one personage message is recorded in the database. In addition, each personage message indicates the position, the physical feature and the residence time of a corresponding tracked person at the tracking time. Then, in the step 120, a personage region for detecting a person is acquired from an input image. After the input image is obtained, any computer vision technology such as an open source computer vision library (OpenCV) may be utilized to search the input image to detect whether there is any feature of a rectangular frame (e.g. a Haar-like feature). In addition, any applicable algorithm (e.g. an Adaboost algorithm) may be utilized to obtain candidate regions for detecting a person. After the improper candidate regions are deleted, the colors of all candidate regions are obtained. By judging whether the colors are skin color, the personage region is acquired. Then, in the step 130, the current position and the current physical feature of the personage region are extracted. Then, in the step 140, the current position and the current physical feature of the detected person corresponding to the personage region are compared with each personage message of the database in order to judge whether the detected person is any tracked person.
Hereinafter, a method of judging whether the detected person is any tracked person according to the similarity will be illustrated in more details. Firstly, a personage message is acquired from the database. Then, a facial texture similarity and a body texture similarity of the current physical feature of the detected person relative to the acquired personage message are calculated. In addition, the displacement amount of the current position of the detected person relative to the acquired personage message should be calculated. Afterwards, the similarity between the detected person and the acquired personage message is calculated according to the facial texture similarity, the body texture similarity and the displacement amount. After each personage message is acquired from the database, the above steps may be repeatedly performed to calculate plural similarities between all personage messages and the detected person.
If the value of the highest similarity among the plural similarities is higher than a first threshold value, the detected person may be considered as the tracked person with the highest similarity. Then, in the step 150, the personage message of the tracked person in the database is updated according to the current position and the current physical feature of the detected person.
On other hand, if all of the calculated similarities are lower than a second threshold value in the step 140, it is considered that the detected person does not comply with all tracked persons. Then, the step 160 is performed. Consequently, a new personage message corresponding to the detected person is added to the database in order to record the detected person as a new tracked person.
If the capacity of the database reaches a critical capacity when the personage message is added to the database, the latest update time of each personage message in the database is firstly acquired, and then the personage message which has not been updated for the longest time is deleted from the database.
Afterwards, the number of persons is calculated according to the residence time of each tracked person in the database (Step 170).
From the above discussions about the conventional method of calculating and tracking the number of persons, a personage region for detecting a person is firstly acquired from an input image, and then each detected person is successively compared with all tracked persons in the database in order to judge whether the detected person is any tracked person. Consequently, the purpose of calculating and tracking the number of persons is achieved.
However, the conventional method still has some drawbacks. For example, it is time-consuming to detect the face image from each input image. After the detected person is acquired from each input image, each detected person is successively compared with all tracked persons in the database. If there are abundant personage messages contained in the database, the overall processing time is increased. In other words, the processing time of the conventional method is very long. Under this circumstance, since a high performance processing device is needed to implement the lengthy and massive computing process, the conventional method fails to meet the requirement of many users.
Moreover, according to the conventional method, if the capacity of the database reaches the critical capacity, the personage message which has not been updated for the longest time is deleted from the database. In other words, some personage messages are lost after the tracking process is ended. Consequently, the accuracy of the tracking result is impaired. For overcoming these problems, the data may be processed in batches in order to avoid losing the personage messages because of too many personage messages. However, the processing time is extended, and the processing complexity is increased.
Therefore, there is a need of providing an improved facial tracking method for calculating and tracking the number of persons in order to overcome the above drawbacks.